
******************************
* online appendix, figure 3
******************************
clear all 
set obs 6  // Set the number of observations for roll1 (0 to 5)
gen roll1 = _n - 1  // Create roll1 variable (0 to 5)

tempfile tempdata
save `tempdata'  // Save this temp data

clear
set obs 6  // Set the number of observations for roll2 (0 to 5)
gen roll2 = _n - 1  // Create roll2 variable (0 to 5)

gen byte dummy = 1  // Add a dummy variable for merging
tempfile tempdata2
save `tempdata2'

clear
use `tempdata'
gen byte dummy = 1
joinby dummy using `tempdata2'  // Create all combinations of roll1 and roll2
drop dummy  // Remove the dummy variable

// Display the final dataset
sort roll1 roll2 

egen report1=rowmax(roll1 roll2)
egen report2=rowmin(roll1 roll2)

drop roll*
rename report* roll*
gen treat=31
append using "data/both.dta"

foreach i of numlist  11 12 13 14 21 22 31 {
qui: eststo: mean roll2 if treat==`i', over(roll1)
}

* colapse data to make summary data
collapse roll2 , by(roll1 treat)


tw  (line roll2 roll1 if treat==11) (line roll2 roll1 if treat==12) ///
(line roll2 roll1 if treat==13) (line roll2 roll1 if treat==14) ///
 (line roll2 roll1 if treat==31, lp(dash)) /// 
, yline(2.5) xtitle("Report 1") ytitle("Average of Report 2") legend( order (3 "c" 1 "a" 2 "b" 4 "d") title("Treatment")) scale(1.2) 
 
graph export "output/appendixfigure3.pdf", as(pdf) name("Graph") replace



